//
//  CYGFBParam.m
//  CreditAddressBook
//
//  Created by LE on 16/1/9.
//  Copyright © 2016年 Lee. All rights reserved.
//

#import "CYGFBParam.h"
#import "YSMD5.h"

@implementation CYGFBParam

- (NSString *)version {
    return @"2.1";
}

- (NSString *)tranCode {
    return @"8888";
}

- (NSString *)feeAmt {
    return @"0.00";
}

- (NSString *)currencyType {
    return @"156";
}

- (NSString *)tranIP {
    return @"127.0.0.1";
}

- (NSString *)buyerName {
    return @"MWAP";
}

- (NSString *)VerficationCode {
    return @"creditmanage";
}

- (NSString *)mobileSighValue {
    return [self mobileSignValueWithDictionary];
}

- (NSString *)signValue {
    return [self signValueWithDictionary];
}
/**
 *  创建mobileSignValue md5 加密字符串
 */
- (NSString *)mobileSignValueWithDictionary {
    NSString *mobileSignValue = [NSString stringWithFormat:@"version=[%@]tranCode=[%@]merchantID=[%@]merOrderNum=[%@]buyerContact=[%@]VerficationCode=[%@]", self.version, self.tranCode, self.merchantID, self.merOrderNum, self.buyerContact, self.VerficationCode];
    CYLog(@"加密前的mobileSignValue:%@", mobileSignValue);
    mobileSignValue = [YSMD5 md5:mobileSignValue];
    return mobileSignValue;
}
/**
 *  创建signValue md5 加密字符串
 */
- (NSString *)signValueWithDictionary {
    NSString *signVaule = [NSString stringWithFormat:@"version=[%@]tranCode=[%@]merchantID=[%@]merOrderNum=[%@]tranAmt=[%@]feeAmt=[%@]tranDateTime=[%@]frontMerUrl=[]backgroundMerUrl=[%@]orderId=[]gopayOutOrderId=[]tranIP=[%@]respCode=[]gopayServerTime=[]VerficationCode=[%@]", self.version, self.tranCode, self.merchantID, self.merOrderNum, self.tranAmt, self.feeAmt, self.tranDateTime, self.backgroundMerUrl, self.tranIP, self.VerficationCode];
    CYLog(@"加密前的signValue:%@", signVaule);
    signVaule = [YSMD5 md5:signVaule];
    return signVaule;
}
@end
